package com.childenglish.service;

import com.childenglish.mapper.ParentChildRelationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class ParentService {

    @Autowired
    private ParentChildRelationMapper relationMapper;

    public boolean hasChildPermission(Long parentId, Long childId) {
        return relationMapper.existsByParentIdAndChildId(parentId, childId);
    }

    public List<Long> getAccessibleChildren(Long parentId) {
        return relationMapper.selectChildIdsByParentId(parentId);
    }
}